package com.hk.springdatajpa.controller;

import com.hk.springdatajpa.entity.Customer;
import com.hk.springdatajpa.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author by 何坤
 * @Classname CustomerController
 * @Description TODO
 * @Date 2019/9/24 12:13
 */
@RestController
public class CustomerController {
    @Autowired
    private CustomerService customerServiceImpl;

    @GetMapping("/save")
    public void testSave(){
        Customer customer = new Customer();
        customer.setName("何坤");
        customer.setAddress("四川省南充市南部县");
        customer.setIndustry("信息技术");
        customer.setPhone("13281896139");
        customer.setSource("文思海辉");
        customer.setLevel("VIP1");
        customerServiceImpl.saveCustomer(customer);
    }
}
